package main

import (
	"fmt"
	"path"
	"path/filepath"
)

func main() {

	// 绝对路径
	filePath1 := "D:/code/me/go/git/src/study-go/goyykfsz/ch09/picture/test.png"
	// 相对路径
	filePath2 := "goyykfsz/ch09/picture/test.png"

	fmt.Println(filepath.IsAbs(filePath1)) // true
	fmt.Println(filepath.IsAbs(filePath2)) // false
	fmt.Println(filepath.Rel("D:/code/me/go", filePath1))
	fmt.Println(filepath.Abs(filePath1))
	fmt.Println(filepath.Abs(filePath2))
	fmt.Println(path.Join(filePath1, ".."))
	fmt.Println(path.Join(filePath1, "."))
	fmt.Println(path.Join("D:/blockChain", filePath2))

}
